package com.wp.controller;

import com.wp.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: WangPeng
 * @createTime: 2022/11/15 9:49
 * @description:
 * @version: v1.0
 */
@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(){
      return "hello"  ;
    }

    @Autowired
    private Student student;
    @GetMapping("/getStudent")
    public Student getStudent(){
        return student;
    }


    @Value("${people.name}")
    private String name;
    @Value("${people.age}")
    private int age;

    @GetMapping("/getMessage")
    public String getMessage(){
        return name+"今年"+age+"岁了。";
    }
}
